package com.tyjt.common.enums;

public enum PubTypeEnum {
    ALL(0),
    PAY_LOAD(1);

    private final int value;

    // 构造函数
    private PubTypeEnum(int value) {
        this.value = value;
    }

    // 获取枚举值对应数值
    public int getValue() {
        return  value;
    }

    // 根据数值获取枚举实例
    public static PubTypeEnum fromValue(int value) {
        for (PubTypeEnum type : PubTypeEnum.values()) {
            if (type.value == value) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid PubTypeEnum value: " + value);
    }
}